From: Maxim Ermilov Date: Sat, 16 Jul 2011 19:27:05 +0000 (+0400) Subject: viewSelector: Bind + for open new window X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~8038 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=203dedfb3ab216ee4bcd5d3a7e158cc9506410ca;p=gnome-shell.git viewSelector: Bind + for open new window https://bugzilla.gnome.org/show_bug.cgi?id=613082 --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 5f38de3a1..992a954ed 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -327,8 +327,16 @@ BaseAppSearchProvider.prototype = { params = Params.parse(params, { workspace: null, timestamp: null }); + let workspace = params.workspace ? params.workspace.index() : -1; + let event = Clutter.get_current_event(); + let modifiers = event ? Shell.get_event_state(event) : 0; + let openNewWindow = modifiers & Clutter.ModifierType.CONTROL_MASK; + let app = this._appSys.get_app(id); - app.activate(params.workspace ? params.workspace.index() : -1); + if (openNewWindow) + app.open_new_window(workspace); + else + app.activate(workspace); }, dragActivateResult: function(id, params) { diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js index 29110fdce..53b349c77 100644 --- a/js/ui/viewSelector.js +++ b/js/ui/viewSelector.js @@ -141,13 +141,19 @@ SearchTab.prototype = { 'edit-find'); this._text.connect('text-changed', Lang.bind(this, this._onTextChanged)); - this._text.connect('activate', Lang.bind(this, function (se) { - if (this._searchTimeoutId > 0) { - Mainloop.source_remove(this._searchTimeoutId); - this._doSearch(); + this._text.connect('key-press-event', Lang.bind(this, function (o, e) { + // We can't connect to 'activate' here because search providers + // might want to do something with the modifiers in activateSelected. + let symbol = e.get_key_symbol(); + if (symbol == Clutter.Return || symbol == Clutter.KP_Enter) { + if (this._searchTimeoutId > 0) { + Mainloop.source_remove(this._searchTimeoutId); + this._doSearch(); + } + this._searchResults.activateSelected(); + return true; } - this._searchResults.activateSelected(); - return true; + return false; })); this._entry.connect('notify::mapped', Lang.bind(this, this._onMapped));